package com.gxa.stu.controller;

import com.gxa.stu.common.JsonResult;
import com.gxa.stu.entity.pojo.Stu;
import com.gxa.stu.service.StuService;
import com.gxa.stu.util.ResponeUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bill
 * @date 2022/11/2 15:42
 */

@Api("学员控制器")
@RestController
@RequestMapping("/stu")
public class StuController {

    /**
     * 执行dubbo的RPC远程调用
     */
    @Reference
    StuService stuService;

    @ApiOperation(value = "获取学员信息的方法")
    @GetMapping("/get")
    public JsonResult get() {
        Stu stu = stuService.get();
        return ResponeUtil.success("success",stu);
    }
}
